//  12435

#include<bits/stdc++.h>

using namespace std;

int main() {
	int n = 5, ans1 = 0 ;
	vector<int> v(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
		for (int j = 0; j < i; j++) {
			if (v[j] > v[i]) ++ans1;
		}
	}
	 
	if (ans1 == 1  ) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}
